package com.zwz.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName comments_info
 */
@Data
public class CommentsInfo implements Serializable {
    /**
     * 评论信息ID
     */
    @TableId(value = "comments_id", type = IdType.AUTO)
    private Integer commentsId;

    /**
     * 评论用户的ID
     */
    private Integer userId;

    /**
     * 被评论航空公司的ID
     */
    private Integer companyId;

    /**
     * 评论内容
     */
    private String commentsContent;

    /**
     * 评论时间
     */
    private Date commentsTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CommentsInfo other = (CommentsInfo) that;
        return (this.getCommentsId() == null ? other.getCommentsId() == null : this.getCommentsId().equals(other.getCommentsId()))
                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
                && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
                && (this.getCommentsContent() == null ? other.getCommentsContent() == null : this.getCommentsContent().equals(other.getCommentsContent()))
                && (this.getCommentsTime() == null ? other.getCommentsTime() == null : this.getCommentsTime().equals(other.getCommentsTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCommentsId() == null) ? 0 : getCommentsId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
        result = prime * result + ((getCommentsContent() == null) ? 0 : getCommentsContent().hashCode());
        result = prime * result + ((getCommentsTime() == null) ? 0 : getCommentsTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", commentsId=").append(commentsId);
        sb.append(", userId=").append(userId);
        sb.append(", companyId=").append(companyId);
        sb.append(", commentsContent=").append(commentsContent);
        sb.append(", commentsTime=").append(commentsTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}